// 2023/5/9

function printStringDetail(str) {
  let detail = '';
  detail += `Character: ${str}, `;
  detail += `string length: ${str.length}, `;
  detail += `UTF-16LE length: ${Buffer.byteLength(str, 'utf16le')}, `;
  detail += `UTF-8 length: ${Buffer.byteLength(str, 'utf8')}`;
  console.log(detail);
}

printStringDetail('a');
printStringDetail('α');
printStringDetail('中');
printStringDetail('😀');
printStringDetail('\u{65}');
printStringDetail('\u{301}');
printStringDetail('\u{65}' + '\u{301}');
